package cn.share.life.system.util.excelMath;

import com.google.common.collect.Maps;

import java.util.Map;

public class MathMain {

    public static void main(String[] args) {
        BaseEntity baseEntity = new BaseEntity();
        baseEntity.setTransmissionPrice(45.1);

        MathResultZeroEntity mathResultZeroEntity = new MathResultZeroEntity();
        mathResultZeroEntity.setBaseEntity(baseEntity);

        Map<Integer, MathResultEntity> historyList = Maps.newConcurrentMap();
        historyList.put(0, mathResultZeroEntity);

        for (int i = 1; i < 36; i++) {
            MathResultEntity mathResultEntity = new MathResultOtherEntity();
            MathResultEntity prefMathResult = historyList.get(i - 1);
            mathResultEntity.setPrefEntity(prefMathResult);
            mathResultEntity.setBaseEntity(baseEntity);
            mathResultEntity.setYear(i);
            historyList.put(i, mathResultEntity);
        }
        System.out.println("计算完成，结果如下：");
        for (int i = 0; i < 36; i++) {
            MathResultEntity mathResultEntity = historyList.get(i);
            System.out.println("第 " + i + " 年的计算结果：");
            System.out.println("年份: " + mathResultEntity.getYear());
            System.out.println("现金流入: " + mathResultEntity.getCashInflow());
            System.out.println("销售收入: " + mathResultEntity.getSalesRevenue());
            System.out.println("输电容量: " + mathResultEntity.getTransmissionCapacity());
            System.out.println("容量电价: " + mathResultEntity.getCapacityPrice());
            System.out.println("输电电量: " + mathResultEntity.getTransmissionElectricity());
            System.out.println("输电电价: " + mathResultEntity.getTransmissionPrice());
            System.out.println("回收流动资金: " + mathResultEntity.getRecoveryWorkingCapital());
            System.out.println("回收固定资产余值: " + mathResultEntity.getRecoveryFixedAssetResidualValue());
            System.out.println("其他收入: " + mathResultEntity.getOtherIncomes());
            System.out.println("现金流出: " + mathResultEntity.getCashOutflow());
            System.out.println("资本金投入: " + mathResultEntity.getCapitalInvestment());
            System.out.println("销售税金及附加: " + mathResultEntity.getSalesTaxesAndSurcharges());
            System.out.println("经营成本: " + mathResultEntity.getOperatingCosts());
            System.out.println("折旧费用: " + mathResultEntity.getDepreciationExpense());

            System.out.println("累计折旧: " + mathResultEntity.getCumulativeDepreciation());

            System.out.println("本金偿还: " + mathResultEntity.getPrincipalRepayment());
            System.out.println("利息支付: " + mathResultEntity.getInterestPayment());
            System.out.println("所得税: " + mathResultEntity.getIncomeTax());
            System.out.println("职工福利基金: " + mathResultEntity.getEmployeeWelfareFund());
            System.out.println("其他支出: " + mathResultEntity.getOtherExpenses());
            System.out.println("利润总额: " + mathResultEntity.getTotalProfit());
            System.out.println("净现金流量: " + mathResultEntity.getNetCashFlow());
            System.out.println("累计净现金流量: " + mathResultEntity.getCumulativeNetCashFlow());
            System.out.println("净现金流量现值: " + mathResultEntity.getNetPresentValue());
            System.out.println("累计净现金流量现值: " + mathResultEntity.getCumulativeNetPresentValue());
            System.out.println("-----------------------------");
        }
    }
}
